﻿using Baidu.Api.Response;
using Baidu.Api.Util;
using System;
using System.Collections.Generic;
using System.Text;

namespace Baidu.Api.Request
{
    /// <summary>
    /// 分片上传—文件分片及上传
    /// </summary>
    public class SuperFileUploadRequest : IBaiduUploadRequest<SuperFileUploadResponse>
    {
        public FileItem File { get; set; }

        #region IBaiduRequest

        public string GetObjectName()
        {
            return "pcs/file";
        }

        public string GetMethod()
        {
            return "upload";
        }

        public IDictionary<string, string> GetFormParameters()
        {
            BaiduDictionary parameters = new BaiduDictionary();
            parameters.Add("type", "tmpfile");
            return parameters;
        }

        public void Validate()
        {
        }

        #endregion

        public IDictionary<string, FileItem> GetFileParameters()
        {
            var dic = new Dictionary<string, FileItem>();
            dic.Add("file", this.File);
            return dic;
        }
    }
}
